************************************************************************
****************** CARTER AND CORRA (2016) MEASURE ******************
************************************************************************


******** Set up ********
clear
cd "/Users/Jacob/Box Sync/Capital-punishment-religion-prejudice"

use "Data/gss-cappun-CLEAN-restrictVars.dta"

*ssc install asdoc
*ssc install outreg2

set scheme s2mono

graph set window fontface "Times New Roman"

******** Add labels ********
label variable punish2_dp "Support for death penalty"
label variable reltrad "Religious tradition"
label variable cc2016_rr "Racial resentment"
label variable bible_literal "Biblical literalism"
label variable church_attend "Religiosity"
label variable partyid "Party identification"
label variable black "Black"
label variable other_race "Other race"
label variable coninc "Family income"
label variable south "South"
label variable age "Age"
label variable bach_degree "Bachelor's degree"
label variable female "Female"

*label define reltrad1 1 "Non-affiliate" 2 "Other religion" 3 "Jewish" 4 "Roman Catholic" 5 "Black Protestant" 6 "Mainline Protestant" 7 "Evangelical Protestant"
*label values reltrad reltrad1

label define cc2016_rr 0 "Low" 1 "Mod. low" 2 "Mod. high" 3 "High"
label values cc2016_rr cc2016_rr

******** Clean variables ********
replace partyid = 3 if partyid == 7
gen log_coninc = ln(coninc)

******** Drop missing values ********
drop if punish2_dp == .
drop if reltrad == .
drop if cc2016_rr == .
drop if bible_literal == .
drop if church_attend == .
drop if partyid == .
drop if black == .
drop if other_race == .
drop if log_coninc == .
drop if south == .
drop if age == .
drop if bach_degree == .
drop if female == .

******** Drop Black respondents and Black Protestants ********
drop if black == 1
drop if reltrad == 5

******** Factor analysis ********
alpha rr_education rr2_lackwill rr3_discrimination
factor rr_education rr2_lackwill rr3_discrimination
******** Main results ********

* Model 1
asdoc logit punish2_dp i.reltrad bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or save(Final-tables/supp-results-cc2016.doc) label nest replace cnames(Model 1)


* Model 2
asdoc logit punish2_dp i.reltrad i.cc2016_rr bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 2)


* Model 3
asdoc logit punish2_dp i.reltrad##i.cc2016_rr bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 3)


******** UPDATED Predicted probability bar plots ********
logit punish2_dp i.reltrad##i.cc2016_rr bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or
	  
estimate store a1 /** store in working memory **/
	  
	margins cc2016_rr, post at(reltrad=(1))
	
	marginsplot, recast (bar) x(cc2016_rr) plotopts(barw(.5)) ///
	ytitle("Predicted % support for CP") title("Non-affiliate", color(black)) name(nones, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1

	  
	margins cc2016_rr, post at(reltrad=(3))
	
	marginsplot, recast (bar) x(cc2016_rr) plotopts(barw(.5)) ///
	ytitle("") title("Catholic", color(black)) name(cath, replace) ///
	xtitle("") ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins cc2016_rr, post at(reltrad=(4))
	
	marginsplot, recast (bar) x(cc2016_rr) plotopts(barw(.5)) ///
	ytitle("") title("Non-denominational Protestant", color(black)) name(non_denom, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins cc2016_rr, post at(reltrad=(6))
	
	marginsplot, recast (bar) x(cc2016_rr) plotopts(barw(.5)) ///
	ytitle("") title("Mainline Protestant", color(black)) name(mp, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins cc2016_rr, post at(reltrad=(7))
	
	marginsplot, recast (bar) x(cc2016_rr) plotopts(barw(.5)) ///
	ytitle("") title("Evangelical Protestant", color(black)) name(ep, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
	
graph combine nones cath non_denom mp ep, col(3) xsize(8) row(1) ycommon name(final_plot, replace) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))

graph export "Final-figures/cc2016_rr-marginal-effects-final-noblack.pdf", replace



************************************************************************
****************** SINGLE ITEM MEASURE ******************
************************************************************************


******** Set up ********
clear
cd "/Users/Jacob/Box Sync/Capital-punishment-religion-prejudice"

use "Data/gss-cappun-CLEAN-restrictVars.dta"

*ssc install asdoc
*ssc install outreg2

set scheme s2mono

graph set window fontface "Times New Roman"

******** Add labels ********
label variable punish2_dp "Support for death penalty"
label variable reltrad "Religious tradition"
label variable rr_single "Racial resentment"
label variable bible_literal "Biblical literalism"
label variable church_attend "Religiosity"
label variable partyid "Party identification"
label variable black "Black"
label variable other_race "Other race"
label variable coninc "Family income"
label variable south "South"
label variable age "Age"
label variable bach_degree "Bachelor's degree"
label variable female "Female"

*label define reltrad1 1 "Non-affiliate" 2 "Other religion" 3 "Jewish" 4 "Roman Catholic" 5 "Black Protestant" 6 "Mainline Protestant" 7 "Evangelical Protestant"
*label values reltrad reltrad1


******** Clean variables ********
replace partyid = 3 if partyid == 7
gen log_coninc = ln(coninc)

******** Drop missing values ********
drop if punish2_dp == .
drop if reltrad == .
drop if rr_single == .
drop if bible_literal == .
drop if church_attend == .
drop if partyid == .
drop if black == .
drop if other_race == .
drop if log_coninc == .
drop if south == .
drop if age == .
drop if bach_degree == .
drop if female == .

******** Drop Black respondents and Black Protestants ********
drop if black == 1
drop if reltrad == 5


******** Main results ********

* Model 1
asdoc logit punish2_dp i.reltrad bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or save(Final-tables/supp-results-rr_single.doc) label nest replace cnames(Model 1)


* Model 2
asdoc logit punish2_dp i.reltrad i.rr_single bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 2)


* Model 3
asdoc logit punish2_dp i.reltrad##i.rr_single bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 3)


******** UPDATED Predicted probability bar plots ********
logit punish2_dp i.reltrad##i.rr_single bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or
	  
estimate store a1 /** store in working memory **/
	  
	margins rr_single, post at(reltrad=(1))
	
	marginsplot, recast (bar) x(rr_single) plotopts(barw(.5)) ///
	ytitle("Predicted % support for CP") title("Non-affiliate", color(black)) name(nones, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1

	  
	margins rr_single, post at(reltrad=(3))
	
	marginsplot, recast (bar) x(rr_single) plotopts(barw(.5)) ///
	ytitle("") title("Catholic", color(black)) name(cath, replace) ///
	xtitle("") ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins rr_single, post at(reltrad=(4))
	
	marginsplot, recast (bar) x(rr_single) plotopts(barw(.5)) ///
	ytitle("") title("Non-denominational Protestant", color(black)) name(non_denom, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins rr_single, post at(reltrad=(6))
	
	marginsplot, recast (bar) x(rr_single) plotopts(barw(.5)) ///
	ytitle("") title("Mainline Protestant", color(black)) name(mp, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins rr_single, post at(reltrad=(7))
	
	marginsplot, recast (bar) x(rr_single) plotopts(barw(.5)) ///
	ytitle("") title("Evangelical Protestant", color(black)) name(ep, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
	
graph combine nones cath non_denom mp ep, col(3) xsize(8) row(1) ycommon name(final_plot, replace) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))

graph export "Final-figures/rr_single_rr-marginal-effects-final-noblack.pdf", replace	


************************************************************************
****************** TUCH AND HUGES (2011) EXACT REPLICATION ******************
************************************************************************


******** Set up ********
clear
cd "/Users/Jacob/Box Sync/Capital-punishment-religion-prejudice"

use "Data/gss-cappun-CLEAN-restrictVars.dta"

*ssc install asdoc
*ssc install outreg2

set scheme s2mono

graph set window fontface "Times New Roman"

******** Create Tuch and Hughes index ********
alpha rr2_lackwill rr3_discrimination rr_single

* factor analysis assuming continuous variables
factor rr2_lackwill rr3_discrimination rr_single
predict resent

* download first: findit polychoricpca
* factor analysis assuming categorical variables
polychoricpca rr2_lackwill rr3_discrimination rr_single, nscore(1) score(resent)
* creates a single variable called resent1

summarize resent resent1
corr resent resent1 
* high correlation, so either could be used

******** Add labels ********
label variable punish2_dp "Support for death penalty"
label variable reltrad "Religious tradition"
label variable resent1 "Racial resentment"
label variable bible_literal "Biblical literalism"
label variable church_attend "Religiosity"
label variable partyid "Party identification"
label variable black "Black"
label variable other_race "Other race"
label variable coninc "Family income"
label variable south "South"
label variable age "Age"
label variable bach_degree "Bachelor's degree"
label variable female "Female"

*label define reltrad1 1 "Non-affiliate" 2 "Other religion" 3 "Jewish" 4 "Roman Catholic" 5 "Black Protestant" 6 "Mainline Protestant" 7 "Evangelical Protestant"
*label values reltrad reltrad1


******** Clean variables ********
replace partyid = 3 if partyid == 7
gen log_coninc = ln(coninc)

******** Drop missing values ********
drop if punish2_dp == .
drop if reltrad == .
drop if resent1 == .
drop if bible_literal == .
drop if church_attend == .
drop if partyid == .
drop if black == .
drop if other_race == .
drop if log_coninc == .
drop if south == .
drop if age == .
drop if bach_degree == .
drop if female == .

******** Drop Black respondents and Black Protestants ********
drop if black == 1
drop if reltrad == 5

******** Main results ********

* Model 1
asdoc logit punish2_dp i.reltrad bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or save(Final-tables/supp-results-th_2011.doc) label nest replace cnames(Model 1)


* Model 2
asdoc logit punish2_dp i.reltrad resent1 bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 2)


* Model 3
asdoc logit punish2_dp i.reltrad##c.resent1 bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 3)

************************************************************************
****************** NATRACE variable  ******************
************************************************************************

******** Set up ********
clear
cd "/Users/Jacob/Box Sync/Capital-punishment-religion-prejudice"

use "Data/gss-cappun-CLEAN-restrictVars.dta"

*ssc install asdoc
*ssc install outreg2

set scheme s2mono

graph set window fontface "Times New Roman"

******** Add labels ********
label variable punish2_dp "Support for death penalty"
label variable reltrad "Religious tradition"
label variable cc2016_rr "Racial prejudice"
label variable bible_literal "Biblical literalism"
label variable church_attend "Religiosity"
label variable partyid "Party identification"
label variable black "Black"
label variable other_race "Other race"
label variable coninc "Family income"
label variable south "South"
label variable age "Age"
label variable bach_degree "Bachelor's degree"
label variable female "Female"

*label define reltrad1 1 "Non-affiliate" 2 "Other religion" 3 "Jewish" 4 "Roman Catholic" 5 "Black Protestant" 6 "Mainline Protestant" 7 "Evangelical Protestant"
*label values reltrad reltrad1



******** Clean variables ********
replace partyid = 3 if partyid == 7
gen log_coninc = ln(coninc)
gen natrace_clean1 = .
replace natrace_clean1 = 1 if natrace == 1
replace natrace_clean1 = 2 if natrace == 2
replace natrace_clean1 = 3 if natrace == 3
replace natrace_clean1 = 2 if natrace == 8

label define natrace_clean1 1 "Low" 2 "Moderate" 3 "High"
label values natrace_clean1 natrace_clean  

******** Drop missing values ********
drop if punish2_dp == .
drop if reltrad == .
drop if natrace_clean == .
drop if bible_literal == .
drop if church_attend == .
drop if partyid == .
drop if black == .
drop if other_race == .
drop if log_coninc == .
drop if south == .
drop if age == .
drop if bach_degree == .
drop if female == .

******** Drop Black respondents and Black Protestants ********
drop if black == 1
drop if reltrad == 5

******** Main results ********

* Model 1
asdoc logit punish2_dp i.reltrad bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or save(Final-tables/supp-results-natrace.doc) label nest replace cnames(Model 1)


* Model 2
asdoc logit punish2_dp i.reltrad i.natrace_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 2)


* Model 3
asdoc logit punish2_dp i.reltrad##i.natrace_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 3)

******** UPDATED Predicted probability bar plots ********
logit punish2_dp i.reltrad##i.natrace_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or
	  
estimate store a1 /** store in working memory **/
	  
	margins natrace_clean, post at(reltrad=(1))
	
	marginsplot, recast (bar) x(natrace_clean) plotopts(barw(.5)) ///
	ytitle("Predicted % support for CP") title("Non-affiliate", color(black)) name(nones, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1

	  
	margins natrace_clean, post at(reltrad=(3))
	
	marginsplot, recast (bar) x(natrace_clean) plotopts(barw(.5)) ///
	ytitle("") title("Catholic", color(black)) name(cath, replace) ///
	xtitle("") ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins natrace_clean, post at(reltrad=(4))
	
	marginsplot, recast (bar) x(natrace_clean) plotopts(barw(.5)) ///
	ytitle("") title("Non-denominational Protestant", color(black)) name(non_denom, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins natrace_clean, post at(reltrad=(6))
	
	marginsplot, recast (bar) x(natrace_clean) plotopts(barw(.5)) ///
	ytitle("") title("Mainline Protestant", color(black)) name(mp, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins natrace_clean, post at(reltrad=(7))
	
	marginsplot, recast (bar) x(natrace_clean) plotopts(barw(.5)) ///
	ytitle("") title("Evangelical Protestant", color(black)) name(ep, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
	
graph combine nones cath non_denom mp ep, col(3) xsize(8) row(1) ycommon name(final_plot, replace) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))

graph export "Final-figures/natrace-rr-marginal-effects-final-noblack.pdf", replace	


************************************************************************
****************** RACPUSH variable  ******************
************************************************************************

******** Set up ********
clear
cd "/Users/Jacob/Box Sync/Capital-punishment-religion-prejudice"

use "Data/gss-cappun-CLEAN-restrictVars.dta"

*ssc install asdoc
*ssc install outreg2

set scheme s2mono

graph set window fontface "Times New Roman"

******** Add labels ********
label variable punish2_dp "Support for death penalty"
label variable reltrad "Religious tradition"
label variable racpush "Racial prejudice"
label variable bible_literal "Biblical literalism"
label variable church_attend "Religiosity"
label variable partyid "Party identification"
label variable black "Black"
label variable other_race "Other race"
label variable coninc "Family income"
label variable south "South"
label variable age "Age"
label variable bach_degree "Bachelor's degree"
label variable female "Female"

*label define reltrad1 1 "Non-affiliate" 2 "Other religion" 3 "Jewish" 4 "Roman Catholic" 5 "Black Protestant" 6 "Mainline Protestant" 7 "Evangelical Protestant"
*label values reltrad reltrad1



******** Clean variables ********
replace partyid = 3 if partyid == 7
gen log_coninc = ln(coninc)
gen racpush_clean = .
replace racpush_clean = 4 if racpush == 1
replace racpush_clean = 3 if racpush == 2
replace racpush_clean = 2 if racpush == 3
replace racpush_clean = 1 if racpush == 4

******** Drop missing values ********
drop if punish2_dp == .
drop if reltrad == .
drop if racpush_clean == .
drop if bible_literal == .
drop if church_attend == .
drop if partyid == .
drop if black == .
drop if other_race == .
drop if log_coninc == .
drop if south == .
drop if age == .
drop if bach_degree == .
drop if female == .

******** Drop Black respondents and Black Protestants ********
drop if black == 1
drop if reltrad == 5

******** Main results ********

* Model 1
asdoc logit punish2_dp i.reltrad bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or save(Final-tables/supp-results-racpush.doc) label nest replace cnames(Model 1)


* Model 2
asdoc logit punish2_dp i.reltrad i.racpush_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 2)


* Model 3
asdoc logit punish2_dp i.reltrad##i.racpush_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 3)

******** UPDATED Predicted probability bar plots ********
logit punish2_dp i.reltrad##i.racpush_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or
	  
estimate store a1 /** store in working memory **/
	  
	margins racpush_clean, post at(reltrad=(1))
	
	marginsplot, recast (bar) x(racpush_clean) plotopts(barw(.5)) ///
	ytitle("Predicted % support for CP") title("Non-affiliate", color(black)) name(nones, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1

	  
	margins racpush_clean, post at(reltrad=(3))
	
	marginsplot, recast (bar) x(racpush_clean) plotopts(barw(.5)) ///
	ytitle("") title("Catholic", color(black)) name(cath, replace) ///
	xtitle("") ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins racpush_clean, post at(reltrad=(4))
	
	marginsplot, recast (bar) x(racpush_clean) plotopts(barw(.5)) ///
	ytitle("") title("Non-denominational Protestant", color(black)) name(non_denom, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins racpush_clean, post at(reltrad=(6))
	
	marginsplot, recast (bar) x(racpush_clean) plotopts(barw(.5)) ///
	ytitle("") title("Mainline Protestant", color(black)) name(mp, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins racpush_clean, post at(reltrad=(7))
	
	marginsplot, recast (bar) x(racpush_clean) plotopts(barw(.5)) ///
	ytitle("") title("Evangelical Protestant", color(black)) name(ep, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
	
graph combine nones cath non_denom mp ep, col(3) xsize(8) row(1) ycommon name(final_plot, replace) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))

graph export "Final-figures/racpush-rr-marginal-effects-final-noblack.pdf", replace	

************************************************************************
****************** HELPBLK variable  ******************
************************************************************************

******** Set up ********
clear
cd "/Users/Jacob/Box Sync/Capital-punishment-religion-prejudice"

use "Data/gss-cappun-CLEAN-restrictVars.dta"

*ssc install asdoc
*ssc install outreg2

set scheme s2mono

graph set window fontface "Times New Roman"

******** Add labels ********
label variable punish2_dp "Support for death penalty"
label variable reltrad "Religious tradition"
label variable helpblk "Racial prejudice"
label variable bible_literal "Biblical literalism"
label variable church_attend "Religiosity"
label variable partyid "Party identification"
label variable black "Black"
label variable other_race "Other race"
label variable coninc "Family income"
label variable south "South"
label variable age "Age"
label variable bach_degree "Bachelor's degree"
label variable female "Female"

*label define reltrad1 1 "Non-affiliate" 2 "Other religion" 3 "Jewish" 4 "Roman Catholic" 5 "Black Protestant" 6 "Mainline Protestant" 7 "Evangelical Protestant"
*label values reltrad reltrad1

******** Clean variables ********
replace partyid = 3 if partyid == 7
gen log_coninc = ln(coninc)
gen helpblk_clean = helpblk

******** Drop missing values ********
drop if punish2_dp == .
drop if reltrad == .
drop if helpblk_clean == .
drop if bible_literal == .
drop if church_attend == .
drop if partyid == .
drop if black == .
drop if other_race == .
drop if log_coninc == .
drop if south == .
drop if age == .
drop if bach_degree == .
drop if female == .

******** Drop Black respondents and Black Protestants ********
drop if black == 1
drop if reltrad == 5

******** Main results ********

* Model 1
asdoc logit punish2_dp i.reltrad bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or save(Final-tables/supp-results-helpblk.doc) label nest replace cnames(Model 1)


* Model 2
asdoc logit punish2_dp i.reltrad i.helpblk_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 2)


* Model 3
asdoc logit punish2_dp i.reltrad##i.helpblk_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or label nest cnames(Model 3)

******** UPDATED Predicted probability bar plots ********
logit punish2_dp i.reltrad##i.helpblk_clean bible_literal church_attend partyid other_race log_coninc south age bach_degree female i.year, or
	  
estimate store a1 /** store in working memory **/
	  
	margins helpblk_clean, post at(reltrad=(1))
	
	marginsplot, recast (bar) x(helpblk_clean) plotopts(barw(.5)) ///
	ytitle("Predicted % support for CP") title("Non-affiliate", color(black)) name(nones, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1

	  
	margins helpblk_clean, post at(reltrad=(3))
	
	marginsplot, recast (bar) x(helpblk_clean) plotopts(barw(.5)) ///
	ytitle("") title("Catholic", color(black)) name(cath, replace) ///
	xtitle("") ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins helpblk_clean, post at(reltrad=(4))
	
	marginsplot, recast (bar) x(helpblk_clean) plotopts(barw(.5)) ///
	ytitle("") title("Non-denominational Protestant", color(black)) name(non_denom, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins helpblk_clean, post at(reltrad=(6))
	
	marginsplot, recast (bar) x(helpblk_clean) plotopts(barw(.5)) ///
	ytitle("") title("Mainline Protestant", color(black)) name(mp, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
estimates restore a1


	margins helpblk_clean, post at(reltrad=(7))
	
	marginsplot, recast (bar) x(helpblk_clean) plotopts(barw(.5)) ///
	ytitle("") title("Evangelical Protestant", color(black)) name(ep, replace) ///
	xtitle("") ///
	xlabel(, nogrid) ///
	ylabel(.5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%", nogrid) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) legend(off) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))
	
	
graph combine nones cath non_denom mp ep, col(3) xsize(8) row(1) ycommon name(final_plot, replace) ///
	plotregion(margin(b=1 l=3 t=0) style(none)) ///
	graphregion(fcolor(white) lcolor(white)) ///
	plotregion(margin(b=1 l=3 t=3) style(none))

graph export "Final-figures/helpblk-rr-marginal-effects-final-noblack.pdf", replace	


